package dao;

import negocio.Insumo;
import negocio.OrdenDeCompra;

import org.hibernate.Session;
import org.hibernate.SessionFactory;

public class InsumoDAO {

	private static InsumoDAO instancia= null;
	private static SessionFactory session = null;
	
	public static InsumoDAO getInstancia(){
		if(instancia == null){
			//sf = HibernateUtil.getSessionFactory();
			instancia = new InsumoDAO();
		} 
		return instancia;
	}
	
	public void grabarOrden (Insumo od)
	{
		Session s = session.openSession();
		s.beginTransaction();
		s.persist(od);
		s.flush();
		s.getTransaction().commit();
		s.close();
	}
	
}